<template>
  <el-dialog :title="title"  center :visible.sync="open" v-if="open" width="1024px" append-to-body :close-on-click-modal="false">
    <el-form ref="detailForm" :model="detailForm.data" :rules="rules" label-width="140px">
      <el-card class="form-card payerInfo-card">
        <div slot="header" class="label-header-msg">
          <span>基本信息</span>
        </div>
        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="交易流水号" prop="bepsId">
              <el-input v-model="detailForm.data.bepsId" :disabled="true" />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="报文标识号" prop="pkgId">
              <el-input v-model="detailForm.data.pkgId" :disabled="true" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="合同协议号" prop="contractNo">
              <el-input v-model="detailForm.data.contractNo" :disabled="true" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="CPG日期" prop="cpgdate">
              <el-date-picker
                v-model="detailForm.data.cpgdate"
                style="width: 100%"
                type="date"
                value-format="yyyyMMdd"
                :disabled="true"
              />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="工作日期" prop="workdate">
              <el-date-picker
                v-model="detailForm.data.workdate"
                style="width: 100%"
                type="date"
                value-format="yyyyMMdd"
                :disabled="true"
              />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="业务类型" prop="bizTypeCode">
              <el-select
                style="width: 100%"
                v-model="
                  detailForm.data.bizTypeCode === null || detailForm.data.bizTypeCode === undefined
                    ? ''
                    : detailForm.data.bizTypeCode + '-' + detailForm.data.bizTypeCodeDesc
                "
                placeholder="业务类型"
                :disabled="true"
              ></el-select>
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="业务种类" prop="bizCtgyCode">
              <el-select
                style="width: 100%"
                v-model="
                  detailForm.data.bizCtgyCode === null || detailForm.data.bizCtgyCode === undefined
                    ? ''
                    : detailForm.data.bizCtgyCode + '-' + detailForm.data.bizCtgyCodeDesc
                "
                placeholder="业务种类"
                :disabled="true"
              ></el-select>
            </el-form-item>
          </el-col>
        </el-row>
      </el-card>
      <el-card class="form-card payerInfo-card">
        <div slot="header" class="label-header-msg">
          <span>收款人信息</span>
        </div>
        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="收款人账号" prop="payeeActno">
              <el-input v-model="detailForm.data.payeeActno" :disabled="true" />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="收款人名称" prop="payeeName">
              <el-input v-model="detailForm.data.payeeName" :disabled="true" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="收款行行号" prop="payeeBrno">
              <el-input v-model="detailForm.data.payeeBrno" :disabled="true" />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="收款行行名" prop="payeeBrname">
              <el-input v-model="detailForm.data.payeeBrname" :disabled="true" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="收款人开户行行号" prop="payeeAccBrno">
              <el-input v-model="detailForm.data.payeeAccBrno" :disabled="true" />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="收款人开户行行名" prop="payeeAccBrname">
              <el-input v-model="detailForm.data.payeeAccBrname" :disabled="true" />
            </el-form-item>
          </el-col>
        </el-row>
      </el-card>
      <el-card class="form-card payerInfo-card">
        <div slot="header" class="label-header-msg">
          <span>付款人信息</span>
        </div>
        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="付款人账号" prop="payerActno">
              <el-input v-model="detailForm.data.payerActno" :disabled="true" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="付款人名称" prop="payerName">
              <el-input v-model="detailForm.data.payerName" :disabled="true" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="付款行行号" prop="payerBrno">
              <el-input v-model="detailForm.data.payerBrno" :disabled="true" />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="付款行行名" prop="payerBrname">
              <el-input v-model="detailForm.data.payerBrname" :disabled="true" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="付款人开户行行号" prop="payerAccBrno">
              <el-input v-model="detailForm.data.payerAccBrno" :disabled="true" />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="付款人开户行名称" prop="payerAccBrname">
              <el-input v-model="detailForm.data.payerAccBrname" :disabled="true" />
            </el-form-item>
          </el-col>
        </el-row>
      </el-card>
      <el-card class="form-card payerInfo-card">
        <div slot="header" class="label-header-msg">
          <span>其他交易信息</span>
        </div>
        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="货币种类" prop="cud">
              <el-input value="CNY" :disabled="true" />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="金额" prop="amount">
              <ht-amount-input v-model="detailForm.data.amount" placeholder="金额" :disable="true"></ht-amount-input>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="回执期限" prop="pkgRtrLtd">
              <el-input v-model="detailForm.data.pkgRtrLtd" :disabled="true" />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="地域标识" prop="regionid">
              <el-select style="width: 100%" v-model="detailForm.data.regionid" placeholder="地域标识" :disabled="true">
                <el-option
                  v-for="dict in dictMap.RegionId"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="24">
            <el-form-item label="附言" prop="oriRemark">
              <el-input type="textarea" v-model="detailForm.data.oriRemark" :disabled="true" />
            </el-form-item>
          </el-col>
        </el-row>
      </el-card>
      <div v-if="this.detailForm.BIZ_TYPE_CODE === 'B104'">
        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="信息流水号" prop="flowNb">
              <el-input v-model="detailForm.data.flowNb" :disabled="true" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="报表日期" prop="reportDate">
              <el-date-picker
                v-model="detailForm.data.reportDate"
                style="width: 100%"
                type="date"
                value-format="yyyyMMdd"
                :disabled="true"
              />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="报表序号" prop="reportNumber">
              <el-input v-model="detailForm.data.reportNumber" :disabled="true" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="上报国库代码" prop="reportCode">
              <el-input v-model="detailForm.data.reportCode" :disabled="true" />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="接收国库代码" prop="receiveCode">
              <el-input v-model="detailForm.data.receiveCode" :disabled="true" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="预算级次" prop="budgetLevel">
              <el-select
                style="width: 100%"
                v-model="detailForm.data.budgetLevel"
                placeholder="预算级次"
                :disabled="true"
              >
                <el-option
                  v-for="dict in dictMap.BUDGETLEVELCODE"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="调整期标志" prop="indicatorCode">
              <el-select
                style="width: 100%"
                v-model="detailForm.data.indicatorCode"
                placeholder="调整期标志"
                :disabled="true"
              >
                <el-option
                  v-for="dict in dictMap.INDICATOR_CODE"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="预算种类" prop="budgetType">
              <el-select
                style="width: 100%"
                v-model="detailForm.data.budgetType"
                placeholder="预算种类"
                :disabled="true"
              >
                <el-option
                  v-for="dict in dictMap.BUDGETTYPECODE"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="明细条数" prop="dtlCount">
              <el-input v-model="detailForm.data.dtlCount" :disabled="true" />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="明细汇总金额" prop="dtlAmount">
              <ht-amount-input
                v-model="detailForm.data.dtlAmount"
                placeholder="明细汇总金额"
                :disable="true"
              ></ht-amount-input>
            </el-form-item>
          </el-col>
        </el-row>

        <!-- addtable_B104 -->
        <ht-table
          ref="dataTableB104"
          :multi-select="false"
          :showSerialNumber="false"
          :dictMap="dictMap"
          :queryParams="this.detailForm.data"
          :tableBindColumns="tableBindColumnsB104"
          :reqConfig="regConfigB104"
          :showRightToolbar="false"
        />
      </div>

      <div v-if="this.detailForm.BIZ_TYPE_CODE === 'B307'">
        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="信息流水号" prop="flowNb">
              <el-input v-model="detailForm.data.flowNb" :disabled="true" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="报表日期" prop="reportDate">
              <el-date-picker
                v-model="detailForm.data.reportDate"
                style="width: 100%"
                type="date"
                value-format="yyyyMMdd"
                :disabled="true"
              />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="报表序号" prop="reportNumber">
              <el-input v-model="detailForm.data.reportNumber" :disabled="true" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="上报国库代码" prop="reportCode">
              <el-input v-model="detailForm.data.reportCode" :disabled="true" />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="接收国库代码" prop="receiveCode">
              <el-input v-model="detailForm.data.receiveCode" :disabled="true" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="明细条数" prop="dtlCount">
              <el-input v-model="detailForm.data.dtlCount" :disabled="true" />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="明细汇总金额" prop="dtlAmount">
              <ht-amount-input
                v-model="detailForm.data.dtlAmount"
                placeholder="明细汇总金额"
                :disable="true"
              ></ht-amount-input>
            </el-form-item>
          </el-col>
        </el-row>

        <!-- addtable_B307 -->
        <ht-table
          ref="dataTableB307"
          :multi-select="false"
          :showSerialNumber="false"
          :dictMap="dictMap"
          :queryParams="this.detailForm.data"
          :tableBindColumns="tableBindColumnsB307"
          :reqConfig="regConfigB307"
          :showRightToolbar="false"
        />
      </div>

      <div v-if="this.detailForm.BIZ_TYPE_CODE === 'B308'">
        <el-card class="form-card txnInfo-card">
          <div slot="header" class="label-header-msg">
            <span>小额支付系统支票截留业务附加数据</span>
          </div>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="出票日期" prop="issueDate">
                <el-date-picker
                  v-model="detailForm.data2.issueDate"
                  style="width: 100%"
                  type="date"
                  value-format="yyyyMMdd"
                  :disabled="true"
                />
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="提示付款日期" prop="payDate">
                <el-date-picker
                  v-model="detailForm.data2.payDate"
                  style="width: 100%"
                  type="date"
                  value-format="yyyyMMdd"
                  :disabled="true"
                />
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="票据号码" prop="noteNumber">
                <el-input v-model="detailForm.data2.noteNumber" :disabled="true" />
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="支付密码" prop="payPassword">
                <el-input v-model="detailForm.data2.payPassword" :disabled="true" />
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="24">
              <el-form-item label="用途" prop="use">
                <el-input v-model="detailForm.data2.use" :disabled="true" />
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="24">
              <el-form-item label="票据正面图像路径" prop="imgFrnData">
                <el-input type="textarea" v-model="detailForm.data2.imgFrnFileName" :disabled="true" />
                <el-button type="primary" v-show="detailForm.data2.imgFrnDownload!==undefined&&detailForm.data2.imgFrnDownload!==null"
                           icon="el-icon-search" plain @click="downloadFile(detailForm.data2.imgFrnDownload)">
                  下载
                </el-button>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="24">
              <el-form-item label="票据背面图像路径" prop="imgBckData">
                <el-input type="textarea" v-model="detailForm.data2.imgBckFileName" :disabled="true" />
                <el-button type="primary" v-show="detailForm.data2.imgBckDownload!==undefined&&detailForm.data2.imgBckDownload!==null"
                           icon="el-icon-search" plain @click="downloadFile(detailForm.data2.imgBckDownload)">
                  下载
                </el-button>
              </el-form-item>
            </el-col>
          </el-row>

        </el-card>
      </div>

      <div
        v-if="
          this.detailForm.BIZ_TYPE_CODE === 'B309' ||
          this.detailForm.BIZ_TYPE_CODE === 'B310' ||
          this.detailForm.BIZ_TYPE_CODE === 'B311'
        "
      >
        <el-card class="form-card txnInfo-card">
          <div slot="header" class="label-header-msg">
            <span>小额支付系统通用票据截留业务附加数据</span>
          </div>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="出票日期" prop="issueDate">
                <el-date-picker
                  v-model="detailForm.data2.issueDate"
                  style="width: 100%"
                  type="date"
                  value-format="yyyyMMdd"
                  :disabled="true"
                />
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="出票货币币种" prop="issueCurrcd">
                <el-input v-model="detailForm.data2.issueCurrcd" :disabled="true" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="出票金额" prop="issueAmount">
                <ht-amount-input
                  v-model="detailForm.data2.issueAmount"
                  placeholder="出票金额"
                  :disable="true"
                ></ht-amount-input>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="提示付款日期" prop="payDate">
                <el-date-picker
                  v-model="detailForm.data2.payDate"
                  style="width: 100%"
                  type="date"
                  value-format="yyyyMMdd"
                  :disabled="true"
                />
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="汇票到期日" prop="draftMaturity">
                <el-date-picker
                  v-model="detailForm.data2.draftMaturity"
                  style="width: 100%"
                  type="date"
                  value-format="yyyyMMdd"
                  :disabled="true"
                />
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="票据号码" prop="noteNumber">
                <el-input v-model="detailForm.data2.noteNumber" :disabled="true" />
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="支付密码" prop="payPassword">
                <el-input v-model="detailForm.data2.payPassword" :disabled="true" />
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="票据密押" prop="draftKey">
                <el-input v-model="detailForm.data2.draftKey" :disabled="true" />
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="承兑协议编号" prop="protoNo">
                <el-input v-model="detailForm.data2.protoNo" :disabled="true" />
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="承兑日期" prop="acceptDate">
                <el-date-picker
                  v-model="detailForm.data2.acceptDate"
                  style="width: 100%"
                  type="date"
                  value-format="yyyyMMdd"
                  :disabled="true"
                />
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="承兑人" prop="acceptor">
                <el-input v-model="detailForm.data2.acceptor" :disabled="true" />
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="申请人账号" prop="applyAccount">
                <el-input v-model="detailForm.data2.applyAccount" :disabled="true" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="申请人名称" prop="applyName">
                <el-input v-model="detailForm.data2.applyName" :disabled="true" />
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="出票人账号" prop="issueAccount">
                <el-input v-model="detailForm.data2.issueAccount" :disabled="true" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="出票人全称" prop="issueName">
                <el-input v-model="detailForm.data2.issueName" :disabled="true" />
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="交易合同号码" prop="pactNumber">
                <el-input v-model="detailForm.data2.pactNumber" :disabled="true" />
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="用途" prop="use">
                <el-input v-model="detailForm.data2.use" :disabled="true" />
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="原收款人名称" prop="oriPayeeName">
                <el-input v-model="detailForm.data2.oriPayeeName" :disabled="true" />
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="24">
              <el-form-item label="票据正面图像路径" prop="imgFrnData">
                <el-input type="textarea" v-model="detailForm.data2.imgFrnFileName" :disabled="true" />
                <el-button type="primary" v-show="detailForm.data2.imgFrnDownload!==undefined&&detailForm.data2.imgFrnDownload!==null"
                           icon="el-icon-search" plain @click="downloadFile(detailForm.data2.imgFrnDownload)">
                  下载
                </el-button>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <el-col :span="24">
              <el-form-item label="票据背面图像路径" prop="imgBckData">
                <el-input type="textarea" v-model="detailForm.data2.imgBckFileName" :disabled="true" />
                <el-button type="primary" v-show="detailForm.data2.imgBckDownload!==undefined&&detailForm.data2.imgBckDownload!==null"
                           icon="el-icon-search" plain @click="downloadFile(detailForm.data2.imgBckDownload)">
                  下载
                </el-button>
              </el-form-item>
            </el-col>
          </el-row>
        </el-card>
      </div>

      <div
        v-if="
          this.detailForm.BIZ_TYPE_CODE === 'B308' ||
          this.detailForm.BIZ_TYPE_CODE === 'B309' ||
          this.detailForm.BIZ_TYPE_CODE === 'B310' ||
          this.detailForm.BIZ_TYPE_CODE === 'B311'
        "
      >
        <el-card class="form-card txnInfo-card">
          <div slot="header" class="label-header-msg">
            <span>被背书人清单</span>
          </div>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="被背书人数" prop="endorserNumber">
                <el-input v-model="detailForm.data2.endorserNumber" :disabled="true" />
              </el-form-item>
            </el-col>
          </el-row>

          <el-row type="flex">
            <ht-table
              ref="dataTableEndorserTb"
              :multi-select="false"
              :showSerialNumber="false"
              :dictMap="dictMap"
              :queryParams="this.detailForm.data"
              :tableBindColumns="tableBindColumnsEndorserTb"
              :reqConfig="regConfigEndorserTb"
              :showRightToolbar="false"
            />
          </el-row>
        </el-card>
      </div>
      <br />
      <el-row type="flex">
        <el-col :span="12">
          <el-form-item label="货币种类" prop="oriSenderTrue">
            <el-input v-model="detailForm.data.drctCny" :disabled="true" />
          </el-form-item>
        </el-col>

        <el-col :span="12">
          <el-form-item label="代理行手续费" prop="proxyFee">
            <ht-amount-input v-model="detailForm.data.proxyFee" placeholder="代理行手续费"></ht-amount-input>
          </el-form-item>
        </el-col>
      </el-row>

      <el-row type="flex">
        <el-col :span="12">
          <el-form-item label="业务回执状态" prop="bizRtStatus">
            <el-select style="width: 100%" v-model="detailForm.data.bizRtStatus" placeholder="业务回执状态">
              <el-option
                v-for="dict in dictMap.BIZRT_STATUS"
                :key="dict.value"
                :label="`${dict.value}-${dict.text}`"
                :value="dict.value"
              ></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>

      <div
        v-if="
          (this.detailForm.BIZ_TYPE_CODE === 'B311' && this.detailForm.BIZ_CTGY_CODE === '03405') ||
          (this.detailForm.BIZ_TYPE_CODE === 'B310' && this.detailForm.BIZ_CTGY_CODE === '03403') ||
          (this.detailForm.BIZ_TYPE_CODE === 'B310' && this.detailForm.BIZ_CTGY_CODE === '03404') ||
          (this.detailForm.BIZ_TYPE_CODE === 'B308' && this.detailForm.BIZ_CTGY_CODE === '03401')
        "
      >
        <div v-if="this.detailForm.data.bizRtStatus === 'PR09'">
          <el-row type="flex">
            <el-col :span="8">
              <el-form-item label="业务拒绝处理码" prop="rejectCode">
                <el-input
                  v-model="detailForm.data.rejectCode"
                  placeholder="请输入业务拒绝处理码"
                  @change="getbase('REJECTCODE')"
                />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-input v-model="detailForm.data.rejectCodeDesc" :disabled="true" />
            </el-col>
            <el-col :span="4">
              <el-row>
                <el-button type="primary" icon="el-icon-search" plain @click="openBasedataDialog('REJECTCODE')">
                  请选择
                </el-button>
              </el-row>
            </el-col>
          </el-row>
        </div>
      </div>

      <div v-else-if="this.detailForm.BIZ_TYPE_CODE === 'B309' && this.detailForm.BIZ_CTGY_CODE === '03402'">
        <div v-if="this.detailForm.data.bizRtStatus === 'PR09'">
          <el-row type="flex">
            <el-col :span="24">
              <el-form-item label="业务拒绝处理码" prop="rejectCodeCheckbox">
                <el-checkbox-group v-model="rejectCodeCheckbox">
                  <el-checkbox
                    v-for="dict in dictMap.REJECTCODE_BILL"
                    :key="dict.value"
                    :label="dict.value"
                    :value="dict.value"
                  >
                    {{ dict.text }}
                  </el-checkbox>
                </el-checkbox-group>
              </el-form-item>
            </el-col>
          </el-row>
        </div>
      </div>

      <div v-else-if="this.detailForm.BIZ_TYPE_CODE === 'B311' && this.detailForm.BIZ_CTGY_CODE === '03406'">
        <div v-if="this.detailForm.data.bizRtStatus === 'PR09'">
          <el-row type="flex">
            <el-col :span="24">
              <el-form-item label="业务拒绝处理码" prop="rejectCodeCheckbox">
                <el-checkbox-group v-model="rejectCodeCheckbox">
                  <el-checkbox
                    v-for="dict in dictMap.REJECTCODE_NOTES"
                    :key="dict.value"
                    :label="dict.value"
                    :value="dict.value"
                  >
                    {{ dict.text }}
                  </el-checkbox>
                </el-checkbox-group>
              </el-form-item>
            </el-col>
          </el-row>
        </div>
      </div>

      <div v-else-if="this.detailForm.BIZ_TYPE_CODE === 'B308' && this.detailForm.BIZ_CTGY_CODE === '03401'">
        <div v-if="this.detailForm.data.bizRtStatus === 'PR09'">
          <el-row type="flex">
            <el-col :span="24">
              <el-form-item label="业务拒绝处理码" prop="rejectCodeCheckbox">
                <el-checkbox-group v-model="rejectCodeCheckbox">
                  <el-checkbox
                    v-for="dict in dictMap.REJECTCODE_030401"
                    :key="dict.value"
                    :label="dict.value"
                    :value="dict.value"
                  >
                    {{ dict.text }}
                  </el-checkbox>
                </el-checkbox-group>
              </el-form-item>
            </el-col>
          </el-row>
        </div>
      </div>

      <div v-else>
        <div v-if="this.detailForm.data.bizRtStatus === 'PR09'">
          <el-row type="flex">
            <el-col :span="8">
              <el-form-item label="业务拒绝处理码" prop="rejectCode">
                <el-input
                  v-model="detailForm.data.rejectCode"
                  placeholder="请输入业务拒绝处理码"
                  @change="getbase('REJECTCODE')"
                />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-input v-model="detailForm.data.rejectCodeDesc" :disabled="true" />
            </el-col>
            <el-col :span="4">
              <el-row>
                <el-button type="primary" icon="el-icon-search" plain @click="openBasedataDialog('REJECTCODE')">
                  请选择
                </el-button>
              </el-row>
            </el-col>
          </el-row>
          <el-row type="flex">
            <el-col :span="24">
              <el-form-item label="业务拒绝原因" prop="rejectContent">
                <el-input type="textarea" v-model="detailForm.data.rejectContent" />
              </el-form-item>
            </el-col>
          </el-row>
        </div>
      </div>

      <el-row type="flex">
        <el-col :span="24">
          <el-form-item label="附言" prop="remark">
            <el-input type="textarea" v-model="detailForm.data.remark" maxlength="135" show-word-limit />
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <div slot="footer" class="dialog-footer" align="center">
      <el-button type="primary" @click="submitForm" v-loading.fullscreen.lock="loading">提 交</el-button>
      <el-button type="primary" @click="cancel">关 闭</el-button>
    </div>

    <base-data-dialog ref="basedataDialog" @confirm="confirmData"></base-data-dialog>
  </el-dialog>
</template>
<script>
import BaseDataDialog from "@/views/components/BasedataDialog";
import HtAmountInput from "@/views/components/HtAmountInput";
import {
  bepsDebitNostroHdWk127B104Query,
  bepsDebitNostroHdWk127B307Query,
  bepsDebitNostroHdWk127EndorserTbQuery,
  bepsDebitNostroHdWkSave127,
} from "@/api/cnaps/beps/baseHandWork/bepsDebitNostroHdWk";
import { amountThousandsFormatter } from "@/utils/table_col_formatter";
import { getBasedata } from "@/api/cnaps/common/basedata";
import { baseUrlConfig, downloadfile } from "@/api/authority_app/base";
export default {
  name: "BepsDebitNostroHdWkDetail127",
  components: { HtAmountInput, BaseDataDialog },
  props: {
    dictMap: {
      type: Object,
      default: () => {
        return {};
      },
    },
    detailForm: {
      type: Object,
      default: () => {
        return {};
      },
    },
  },
  data() {
    return {
      // 是否显示弹出层
      open: false,
      loading: false,
      title: "小额借记来账手工处理明细",
      rules: {
        bizRtStatus: [{ required: true, message: "请输入业务回执状态", trigger: "blur" }],
        rejectCode: [{ required: true, message: "请输入业务拒绝处理码", trigger: "blur" }],
        rejectCodeCheckbox: [{ required: true, message: "请输入业务拒绝处理码", trigger: "blur" }],
        rejectContent: [{ max: 105, message: "最大位数为105位", trigger: "blur" }],
        remark: [{ max: 135, message: "最大位数为135位", trigger: "blur" }],
      },
      rejectCodeCheckbox: "",
      regConfigB104: bepsDebitNostroHdWk127B104Query,
      regConfigB307: bepsDebitNostroHdWk127B307Query,
      regConfigEndorserTb: bepsDebitNostroHdWk127EndorserTbQuery,
      tableBindColumnsB104: [
        { prop: "deptCode", label: "征收机关大类代码", dictCode: "DEPT_CODE" },
        { prop: "subjectCode", label: "预算科目代码" },
        { prop: "currcd", label: "发生额币种" },
        { prop: "amount", label: "发生额", type: "price" },
      ],
      tableBindColumnsB307: [
        { prop: "debtBankType", label: "兑付国债银行大类" },
        { prop: "capitalCode", label: "本金代码" },
        { prop: "capitalAmount", label: "本金金额", type: "price" },
        { prop: "accrualCode", label: "利息代码" },
        { prop: "accrualCurcd", label: "利息金额币种" },
        { prop: "accrualAmount", label: "利息金额", type: "price" },
      ],
      tableBindColumnsEndorserTb: [{ prop: "endorserName", label: "被背书人名称" }],
    };
  },
  mounted() {},
  methods: {
    show() {
      this.open = true;

      if (this.detailForm.data2.imgFrnData !== undefined) {
        let imgFrnFileName = this.detailForm.data2.imgFrnData.split("||");
        if (imgFrnFileName.length > 1) {
          this.$set(this.detailForm.data2, "imgFrnFileName", imgFrnFileName[1]);
          this.$set(this.detailForm.data2, "imgFrnDownload", this.detailForm.data2.imgFrnData);
        }
      }
      if (this.detailForm.data2.imgBckData !== undefined) {
        let imgBckFileName = this.detailForm.data2.imgBckData.split("||");
        if (imgBckFileName.length > 1) {
          this.$set(this.detailForm.data2, "imgBckFileName", imgBckFileName[1]);
          this.$set(this.detailForm.data2, "imgBckDownload", this.detailForm.data2.imgBckData);
        }
      }
    },

    cancel() {
      this.open = false;
    },

    openBasedataDialog(dataType = "") {
      this.$refs.basedataDialog.show(dataType);
    },

    confirmData(fromFlag, row) {
      this.$set(this.detailForm.data, "rejectCode", row.dataValue);
      this.$set(this.detailForm.data, "rejectCodeDesc", row.dataDesc);
    },

    //回车获取basedata值
    getbase(dataType) {
      const dataValue = this.detailForm.data.rejectCode;
      getBasedata(dataType, dataValue)
        .then((response) => {
          if (response.code == "S" && response.result !== null && response.result !== undefined) {
            this.$set(this.detailForm.data, "rejectCode", response.result.dataValue);
            this.$set(this.detailForm.data, "rejectCodeDesc", response.result.dataDesc);
          } else {
            this.msgSuccess("找不到对应的字典项");
            this.$set(this.detailForm.data, "rejectCode", null);
            this.$set(this.detailForm.data, "rejectCodeDesc", null);
          }
        })
        .catch((err) => {
          this.$set(this.detailForm.data, "rejectCode", null);
          this.$set(this.detailForm.data, "rejectCodeDesc", null);
        });
    },

    submitForm: function () {
      this.$refs["detailForm"].validate((valid) => {
        if (valid) {
          this.detailForm.data.rejectCodeCheckbox = this.rejectCodeCheckbox;
          this.loading = true;
          bepsDebitNostroHdWkSave127(this.detailForm.data)
            .then((response) => {
              this.msgSuccess("录入成功");
              this.open = false;
              this.$nextTick(() => {
                this.$parent.$refs.dataTable.doQuery(true);
              });
              this.loading = false;
            })
            .catch((err) => {
              this.loading = false;
            });
        }
      });
    },

    downloadFile(fileId) {
      if (fileId !== undefined && fileId !== "") {
        downloadfile(`${baseUrlConfig.downloadFile}`, fileId).then((response) => {
          let blob = new Blob([response.data], { type: "image/jpeg" });
          console.log(response);
          let objectUrl = URL.createObjectURL(blob);
          const link = document.createElement("a"); // 创建a标签
          link.href = objectUrl;
          // const fileNameSplit = response.headers['content-disposition'].split('=')
          // const fileName = decodeURI(fileNameSplit[fileNameSplit.length - 1]) // 跟后端约定好最后一个值为fileName字段
          link.download = fileId.split("||")[1]; // 自定义文件名

          link.click(); // 下载文件
          URL.revokeObjectURL(objectUrl); // 释放内存
        });
      } else {
        this.msgError("下载文件不存在");
      }
    },


  },
};
</script>
<style>
.label-header-msg {
  font-weight: bold;
}

.form-card {
  margin-bottom: 10px;
}
</style>
